package com.feicheng.persistence.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.feicheng.common.result.ResultInfo;
import com.feicheng.persistence.entity.Client;
import com.feicheng.persistence.mapper.ClientMapper;
import com.feicheng.persistence.service.IClientService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cailongyang
 * @since 2024-08-21
 */
@Service
public class ClientServiceImpl extends ServiceImpl<ClientMapper, Client> implements IClientService {
//    @Autowired
//    IClientService iClientService;
//    @Autowired
//    ClientMapper clientMapper;
//    @Override
//    public ResultInfo getClientPage(JSONObject param){
//        Integer current = param.getInteger("current");
//        Integer size = param.getInteger("size");
//        String nickname = param.getString("nickname");
//        QueryWrapper<JSONObject> qw = new QueryWrapper<>();
//
//        IPage<JSONObject> client = new Page<>(current,size);
//        return ResultInfo.success(clientMapper.getClientPage(client,qw));
//
//
//
//    }
//    @Override
//    public ResultInfo getDetail(String clientid){
//        QueryWrapper<Client> qw = new QueryWrapper<>();
//        qw.eq("clientid",clientid);
//        return ResultInfo.success(clientMapper.getDetail(qw));
//}
//
//    @Override
//    public ResultInfo getClientYjPage(JSONObject param) {
//        Integer current = param.getInteger("current");
//        Integer size = param.getInteger("size");
//        QueryWrapper<JSONObject> qw = new QueryWrapper<>();
//        return ResultInfo.success(clientMapper.getClientYjPage(new Page<>(current,size),qw));
//    }
//
//    @Override
//    public ResultInfo getClientYjByFrom(String clientid) {
//        Client client = clientMapper.getClientYjById(clientid);
//        List<Client> clients = clientMapper.getClientsYjByFrom(clientid);
//        Map<String,Object> map = new HashMap<>();
//        map.put("client",client);
//        map.put("tjClients",clients);
//        return ResultInfo.success(map);
//    }
}
